package cloud.zt.springboot.web.domain;

import cloud.zt.springboot.utils.StringUtils;

/**
 * @author RedReins
 * @version 1.0
 * @description: TODO
 * @date 2021/9/17 15:54
 */

public class PageDomain {
    /*当前页数*/
    private Integer PageNum;
    /*页面中的行数*/
    private Integer PageSize;
    /*排序的顺序*/
    private String orderByColumn;

    /** 排序的方向desc或者asc */
    private String isAsc = "asc";

    public Integer getPageNum() {
        return PageNum;
    }

    public void setPageNum(Integer pageNum) {
        PageNum = pageNum;
    }
    public String getOrderBy(){
        if (StringUtils.isEmpty(orderByColumn))
        {
            return "";
        }
        return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
    }

    public Integer getPageSize() {
        return PageSize;
    }

    public void setPageSize(Integer pageSize) {
        PageSize = pageSize;
    }

    public String getOrderByColumn() {
        return orderByColumn;
    }

    public void setOrderByColumn(String orderByColumn) {
        this.orderByColumn = orderByColumn;
    }

    public String getIsAsc() {
        return isAsc;
    }

    public void setIsAsc(String isAsc) {
        this.isAsc = isAsc;
    }
}
